<%@page import="java.util.ArrayList"%>
<%@page import="com.portal4kids.model.Travel"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/themes/base/jquery.ui.all.css">
<link rel="stylesheet" href="css/demos.css">
	<link rel="stylesheet" href="css/search_style.css">
	<script src="js/jquery-1.7.2.js"></script>
	<script src="js/ui/jquery.ui.core.js"></script>
	<script src="js/ui/jquery.ui.widget.js"></script>
	<script src="js/ui/jquery.ui.accordion.js"></script>
<title>Portal4kids</title>
<style>
		body { font-size: 62.5%; }
		label, input { display:block; }
		input.text { margin-bottom:12px; width:95%; padding: .4em; }
		fieldset { padding:0; border:0; margin-top:25px; }
		h1 { font-size: 1.2em; margin: .6em 0; }
		div#users-contain { width: 350px; margin: 20px 0; }
		div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
		div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
		.ui-dialog .ui-state-error { padding: .3em; }
		.validateTips { border: 1px solid transparent; padding: 0.3em; }
	</style>
	
<script>
	$(function() {
		$( "#accordion" ).accordion({
			collapsible: true
		});
	});
</script>
	
</head>
<body background="images/bg_search.jpg">
<div id="top">
 <ul id=menu>
       <li><a href="index.jsp">home</a></li>
      <li><a href="baner/newses.jsp">aktualności</a></li>

      <li><a href=#>oceny</a></li>
      <li><a href="baner/aboutAs.jsp">o nas</a></li>
      <li><a href="baner/contact.jsp">kontakt</a></li>    </ul>
</div>

<div id=bottom>
	<% if(request.getAttribute("travelList") !=  null) {
		List<Travel> travelList = new ArrayList<Travel>();
		travelList = (List<Travel>)request.getAttribute("travelList");
		if(!travelList.isEmpty()){
	%>
	<div id="users-contain" class="ui-widget">
	<h2 style="color:white;">Wyniki wyszukiwania:</h2>
	<table id="users" class="ui-widget ui-widget-content">
		<thead>
			<tr class="ui-widget-header ">
				<th>Nazwa</th>
				<th>Ocena</th>
				<th>Liczba głosów</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="travelList">
				<tr>
					<td><a href="travelDetails.jsp?id=<s:property value="id_travel"/>"><s:property value="name"/></a> </td>
					<td><s:property value="avarage"/></td>
					<td><s:property value="numberOfVotes"/></td>
				</tr>
			</s:iterator>
			
		</tbody>
	</table>
	</div>
	<%} else{ %>
		<div class="ui-widget">
						<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
							<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
							<strong>Nie znaleziono biur podróży spełniających twoje kryteria.</strong> <br /><br /> Zmień kryteria wyszukiawń</p>
						</div>
		</div>
	
	<%} } %>
	
	<div class="demo">

				<div id="accordion">
					<h3><a href="#">Biura Podróży</a></h3>
					<div>
						<form action="showTravel" method="post">
							<table>
								<tr>
									<td><b>Wybierz dzielnice</b> </td>
									<td><select name="travel.adress">
										<option>Dowolna</option>
										<option>Bemowo</option>
										<option>Białołęka</option>
										<option>Bielany</option>
										<option>Mokotów</option>
										<option>Ochota</option>
										<option>Praga Południe</option>
										<option>Praga Północ</option>
										<option>Rembertów</option>
										<option>Śródmieście</option>
										<option>Targówek</option>
										<option>Ursus</option>
										<option>Ursynów</option>
										<option>Wawer</option>
										<option>Wesoła</option>
										<option>Wilanów</option>
										<option>Włochy</option>
										<option>Wola</option>
										<option>Żoliborz</option>
									</select></td>
								</tr>
								
								<tr>
									<td width="250px;">Specjalne oferty dla rodziców z dziećmi</td>
									<td><input type="checkbox" name="travel.attributes" value="TAK" /></td>
								</tr>
								<tr>
									<td colspan="2">&nbsp</td>
								</tr>
								<tr>
									<td colspan="2"><input type="submit" value="Wyszukaj"></td>
								</tr>
							</table>
						</form>
					</div>
			</div>
	</div>
</div>
</body>
</html>